import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

function pathResolve(dir: string) {
  return path.resolve(process.cwd(), dir)
}

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: '0.0.0.0',
    port: 4399,
    open: true
  },
  resolve: {
    alias: [
      {
        find: /\/@\//,
        replacement: pathResolve('src') + '/'
      },
      {
        find: /\/#\//,
        replacement: pathResolve('types') + '/'
      }
    ]
  }
})
